package com.chalk.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.chalk.model.Member;
import com.chalk.vo.MyMemberVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 会员表(Member)表数据库访问层
 *
 * @author maxiaoqiang
 * @since 2019-03-22 17:38:23
 */
@Mapper
public interface MemberDao extends BaseMapper<Member> {

    /*自定义接口*/

    /**
     * 根据主键批量(逻辑)删除
     *
     * @param ids
     * @return
     */
    int deleteBatchByPrimaryKey(String[] ids);

    Member getMemberByMobilePhone(String mobilePhone);


    /**
     * 获取我的客户
     * @param page
     * @param memberIds
     * @param myMemberVo
     * @return
     */

    List<Member> getMyMembers(Page<Member> page, @Param("myMemberVo")MyMemberVo myMemberVo, @Param("memberIds") List<String> memberIds);


    /**
     *   获取门店会员列表
     * @param page
     * @param map
     * @return
     */
    List<Member> getMembersByShopId(Page<Member> page, @Param("param") Map<String,Object> map);


    /**
     * 通过memberId获取会员基本信息
     * @param memberId
     * @return
     */
    Member getInfoByMemberId(String memberId);


}